/*
 * @Author: yangzonglong
 * @Date: 2020-07-30 11:06:16
 * @version: v1.0.0
 * @Descripttion: 
 * @LastEditors: yangzonglong
 * @LastEditTime: 2021-01-21 14:12:44
 * @Auditor: 
 */
import { Input as AntdInput, Switch, DatePicker as AntdDatePicker } from 'antd';
import Select from './../select/Select';
import ModalTableInModelInput from './extra/ModalTableInModelInput';
import ConsoleSelect from './../select/ConsoleSelect';
import CompanySelect from './../select/CompanySelect';
import MoneyInputNumber from './extra/MoneyInputNumber';
import Cascader from './../cascader/Cascader';
import FileUploadInput from './extra/FileUploadInput';
import InputNumber from './extra/InputNumber';
import CityCascader from './extra/CityCascader';
import DatePicker from './extra/DatePicker';
import AutoComplete from './../autoComplete/AutoComplete';
import Checkbox from './extra/Checkbox';
import UserInput from './extra/UserInput';
import Radio from './../radio/Radio';
import PrintTemplateSelect from '../printTemplateSelect/PrintTemplateSelect';

export const FormxControlTypes = {
  INPUT: 'input',
  SELECT: 'select',
  NUMBER: 'number',
  DATE: 'date',
  RANGE_PICKER: 'rangePicker',
  SWITCH: 'switch',
  TEXT_AREA: 'textArea',
  MONEY: 'money',
  FILE_UPLOAD: 'fileUpload',
  MODAL_TABLE: 'modalTableInModel',
  CASCADER: 'cascader',
  CONSOLE_SELECT: 'consoleSelect',
  COMPANY_SELECT: 'companySelect',
  CITY_CASCADER: 'cityCascader',
  AUTO_COMPLETE: 'autoComplete',
  CHECKBOX: 'checkbox',
  USER_INPUT: 'userInput',
  RADIO: 'radio',
  PRINT_TEMPLATE_SELECT: 'printTemplateSelect'
};

export const ControlMap = {
  [FormxControlTypes.INPUT]: AntdInput,
  [FormxControlTypes.NUMBER]: InputNumber,
  [FormxControlTypes.DATE]: DatePicker,
  [FormxControlTypes.SELECT]: Select,
  [FormxControlTypes.CONSOLE_SELECT]: CompanySelect,
  [FormxControlTypes.COMPANY_SELECT]: CompanySelect,
  [FormxControlTypes.MODAL_TABLE]: ModalTableInModelInput,
  [FormxControlTypes.SWITCH]: Switch,
  [FormxControlTypes.TEXT_AREA]: AntdInput.TextArea,
  [FormxControlTypes.MONEY]: MoneyInputNumber,
  [FormxControlTypes.CASCADER]: Cascader,
  [FormxControlTypes.FILE_UPLOAD]: FileUploadInput,
  [FormxControlTypes.RANGE_PICKER]: AntdDatePicker.RangePicker,
  [FormxControlTypes.CITY_CASCADER]: CityCascader,
  [FormxControlTypes.AUTO_COMPLETE]: AutoComplete,
  [FormxControlTypes.CHECKBOX]: Checkbox,
  [FormxControlTypes.USER_INPUT]: UserInput,
  [FormxControlTypes.RADIO]: Radio,
  [FormxControlTypes.PRINT_TEMPLATE_SELECT]: PrintTemplateSelect
};

export const PatternMap = {
  LETTER_NUMBERS: 'letterNumbers',
  MAIL: 'mail',
  PHONE: 'phone',
  ID_NUMBER: 'idNumber'
};